package com.steak.system.common.exception;

public enum EmBusinessError implements CommonError {
    /**
     * 通用错误类型
     */
    PARAMETER_VALIDATION_ERROR(10001,"参数不合法"),
    UNKNOWN_ERROR(10002,"未知错误,请联系管理员"),

    USER_NOT_EXIST(20001,"用户不存在"),
    PASSWORD_ERROR(20002,"密码错误"),

    RESULT_NULL(30001,"没有记录"),

    //权限
    NO_LOGIN(40002,"请登陆后再操作"),
    NO_AUTH(40001,"对不起,您没有权限访问")
    ;

   private int errorCode;
   private String errorMsg;

    EmBusinessError(int errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    @Override
    public int getErrorCode() {
        return this.errorCode;
    }

    @Override
    public String getErrorMsg() {
        return this.errorMsg;
    }

    @Override
    public CommonError setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
        return this;
    }
}
